let v = new Vue({
    el:'#app',
    data:{
        article:{
            title:'',
            content:''
        }
    },
    methods:{
        insertArticle:function (){
            axios.post(`article/insertArticle`,this.article)
                .then(response=>{
                    if (response.data.flag){
                        layer.msg("发布成功");
                        this.article.title='';
                        this.article.content = '';
                    }
                }).catch(error=>{
                    layer.msg(error.message);
            })
        }
    }
})